/*
 * @Date: 2022-05-16 13:36:43
 * @LastEditors: sailornpg
 * @LastEditTime: 2022-05-16 17:49:37
 * @FilePath: \react-lvyou\src\api\user.ts
 * @Description: something
 */
import { request } from "@/utils/request";
//获取购物车列表
export const reqShoppingCartList = (token: string) => {
  return request({
    url: `/shoppingCart`,
    method: "get",
    headers: {
      Authorization: `bearer ${token}`,
    },
  });
};
//添加购物车
export const reqAddShoppingCart = (
  token: string,
  data: { touristRouteId: string },
) => {
  return request({
    url: `/shoppingCart/items`,
    method: "post",
    headers: {
      Authorization: `bearer ${token}`,
    },
    data,
  });
};
//清空购物车
export const reqClearShoppingCart = (token: string, itemsIds: number[]) => {
  return request({
    url: `/shoppingCart/items/(${itemsIds.join(",")})`,
    method: "delete",
    headers: {
      Authorization: `bearer ${token}`,
    },
  });
};
